package org.binglan.youziyuepai.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiOperation;
import org.binglan.youziyuepai.entity.School;
import org.binglan.youziyuepai.service.SchoolService;
import org.binglan.youziyuepai.utils.ResponseVoUtils;
import org.binglan.youziyuepai.vo.ResponseVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @description:
 * @author: sanjin
 * @date: 2019/4/13 18:09
 */
@Api(tags = "学校相关接口")
@RestController
@RequestMapping("/school")
public class SchoolController {

    @Autowired
    SchoolService schoolService;

    @ApiOperation(value = "获取学校列表",notes = "获取学校列表")
    @GetMapping("")
    public ResponseVo getSchools() {
        List<School> schools = schoolService.querAllSchool();

        return ResponseVoUtils.success(schools);
    }
}
